<?php
/**
 * @version		$Id: default.php 3 2011-12-16 20:19:15Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */
 
defined('_JEXEC') or die('Restricted Access');

JHtml::_('behavior.tooltip');
$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
?>
<div><?php echo $this->loadTemplate('menu');?></div>
<form action="<?php echo JRoute::_('index.php?option=com_almhoster&view=orders'); ?>" method="post" name="adminForm">
	<div class="display-limit">
		<?php echo JText::_('Limit'); ?>&#160;
		<?php echo $this->pagination->getLimitBox(); ?>
	</div>
<table class="tabela">
	<thead>
		<tr>
			<th>
				<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ORDER_ID', 'OrderId', $listDirn, $listOrder); ?>
			</th>
			<th>
				<?php echo JHtml::_('grid.sort',  'Product', 'COM_ALMHOSTER_ORDER_PRODUCT', $listDirn, $listOrder); ?>
			</th>
			<th>
				<?php echo JHtml::_('grid.sort',  'Domain', 'COM_ALMHOSTER_ORDER_DOMAIN', $listDirn, $listOrder); ?>
			</th>
			<th>
				<?php echo JHtml::_('grid.sort',  'Next billing', 'COM_ALMHOSTER_ORDER_NEXT_BILLING', $listDirn, $listOrder); ?>
			</th>
			<th>
				<?php echo JHtml::_('grid.sort',  'Billing cycle', 'COM_ALMHOSTER_ORDER_BILLING_CYCLE', $listDirn, $listOrder); ?>
			</th>
			<th>
				<?php echo JHtml::_('grid.sort',  'Status', 'COM_ALMHOSTER_ORDER_STATUS', $listDirn, $listOrder); ?>
			</th>
		</tr>
	</thead>
	<tbody>
		<?php foreach($this->items as $i => $item): ?>
		<tr class="row<?php echo $i % 2; ?>">
			<td align="center">
				<?php printf("%05d",$item->OrderId); ?>
			</td>
			<td>
				<a href="<?php echo JRoute::_('index.php?option=com_almhoster&view=order&OrderId=' . $item->OrderId); ?>">
				<?php echo $item->OrderProduct; ?>
				</a>
			</td>
			<td>
				<strong><?php echo $item->OrderDomain; ?></strong>
			</td>
			<td align="center">
				<?php echo $item->OrderNextBilling; ?>
			</td>
			<td align="center">
				<?php echo $item->billing_cycle; ?>
			</td>
				<?php
					if ($item->OrderStatus == 0) { ?>
			<td align="center" style= "background-color: #faf29f">
				<strong>
					<?php echo JText::_('COM_ALMHOSTER_LIST_ORDER_STATUS_'.$item->OrderStatus); ?>
				</strong>
			</td>
				<?php
					} if ($item->OrderStatus == 1) { ?>
			<td align="center" style= "background-color: #a8db99">
				<strong>
				<?php echo JText::_('COM_ALMHOSTER_LIST_ORDER_STATUS_'.$item->OrderStatus); ?>
				</strong>
			</td>
			<?php
				} if ($item->OrderStatus == 2) { ?>
			<td align="center" style= "background-color: #c9ddde">
				<strong>
				<?php echo JText::_('COM_ALMHOSTER_LIST_ORDER_STATUS_'.$item->OrderStatus); ?>
				</strong>
			</td>				
				<?php
				}	if ($item->OrderStatus == 3) { ?>
			<td align="center" style= "background-color: #ff6666">
				<strong>
				<?php echo JText::_('COM_ALMHOSTER_LIST_ORDER_STATUS_'.$item->OrderStatus); ?>
				</strong>
			</td>
				<?php
					} ?>				
		</tr>
		<?php endforeach; ?>
	</tbody>
	<tfoot>
	</tfoot>
</table>
	<div class="pagination">
		<p class="counter">
			<?php echo $this->pagination->getPagesCounter(); ?>
		</p>
			<?php echo $this->pagination->getPagesLinks(); ?>
	</div>
	<div>
		<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
		<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
	</div>	
</form>